package com.shujia.profile.info.platform

import com.shujia.profile.UserProfile
import com.shujia.util.SparkUtil
import org.apache.spark.sql.{DataFrame, SparkSession}

class UserProfileRegTime extends UserProfile {

  flagName = "regTime"

  /**
   * 用于提取用户画像的接口
   *
   * @param spark ： spark环境
   * @return
   */
  override def extractProfile(spark: SparkSession): DataFrame = {

    spark.sql(
      """
        |select  id ,create_time as regTime from
        |dim.dim_pub_t_member
        |
        |""".stripMargin)
  }
}

object UserProfileRegTime {
  def main(args: Array[String]): Unit = {
    //获取参数,在提交任务时，在包名后面增加的参数
    val ds: String = args.head
    //spark环境
    val spark: SparkSession = SparkUtil.getSession()

    new UserProfileRegTime().run(spark, ds)
  }
}
